package com.sys.db.daoImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sys.db.dao.DefJobDao;
import com.sys.pojo.DefJob;

public class DefJobDaoImpl extends SqlMapClientDaoSupport implements DefJobDao {

	public void delete(int id) throws Exception {
		
		this.getSqlMapClientTemplate().delete("DefJob.delete",id);
	}

	public List findAll() throws Exception {
		List list=this.getSqlMapClientTemplate().queryForList("DefJob.findAll");
		return list;
	}
	public List findByPage(int start,int limit) throws Exception {
		
		Map map=new HashMap<String,Integer>();
		map.put("start", start);
		map.put("end", start+limit);
		List list=this.getSqlMapClientTemplate().queryForList("DefJob.findByPage",map);
		return list;
	}
	public DefJob findById(int id) throws Exception {
		
		DefJob d=(DefJob) this.getSqlMapClientTemplate().queryForObject("DefJob.findById",id);
		return d;
	}

	public void save(DefJob defJob) throws Exception {
		
		this.getSqlMapClientTemplate().insert("DefJob.insert",defJob);
	}

	public void update(DefJob defJob) throws Exception {
		
		this.getSqlMapClientTemplate().update("DefJob.update",defJob);
	}

	public List findParaById(int jobId) throws Exception {
		
		List list=this.getSqlMapClientTemplate().queryForList("DefJob.findParaById",jobId);
		return list;
	}

	public List findAllTypePara() throws Exception {
		List list =this.getSqlMapClientTemplate().queryForList("DefJob.findAllTypePara");
		return list;
	}

	

}
